#region File Header

//----------------------------------------------------------------
// Copyright (C) 2002 Stefan Kyntchev
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR 
// FITNESS FOR A PARTICULAR PURPOSE.
//----------------------------------------------------------------

#endregion File Header

using System;
using AirWeb.ApplicationTools;

namespace FlashBack.Web
{
	/// <summary>
	/// Summary description for WhatIsNew.
	/// </summary>
	public partial class WhatIsNew : PicDirTree
	{
		protected override void Initialze()
		{
			if (m_cacheModel)
				MyTree.TreeModel = GetTreeModel();
			else
				MyTree.TreeModel = CreateTreeModel();

			// Set how many levels of the tree should be expanded
			MyTree.AutoExpandLevel = 100;
		}

		protected override DirectoryTreeModel CreateTreeModel()
		{
			string filter = TimeSelector.SelectedItem.Value;

			DirectoryTreeModel m = new DirectoryTreeModel(CurrentUser, Context);
			DirectoryHelper d = new DirectoryHelper();

			string rpath = Server.MapPath(d.CreateOriginalPath("\\"));
			m.SetPath(rpath);

			m.SetFilter(Convert.ToInt16(filter));
			MyTree.IfEmptyText =
				"There are no new pictures available at this time.<br> Please select a different period.<br><br> To browse existing albums select <b>Albums</b> below.";

			return m;
		}

	}
}